import {
  HTTP
} from '../utils/http.js'

class HomeHttp extends HTTP {
  // 主页推荐
  getGoodsRecommend(data, isShowLoading) {
    return this.request({
      url: 'yddgoods/GoodsRecommendV2',
      method: 'POST',
      data: data,
      isShowLoading: isShowLoading||false
    })
  }

  // 获取服务中心信息
  getServiceCenterInfo(data) {
    return this.request({
      url: 'yddgoods/ServiceCoreDetails',
      method: 'POST',
      data: data
    })
  }

  // 附近服务中心
  getNearbyServiceCenter(data) {
    return this.request({
      url: 'yddgoods/NearbyServiceCore',
      method: 'POST',
      data: data
    })
  }

  // 获取附近服务点
  getNearbyServicePoint(data) {
    return this.request({
      url: 'yddgoods/YddServicePoint',
      method: 'POST',
      data: data,
      isShowLoading: false
    })
  }

  // 附近商家
  getNearbyStore(data, isShowLoading) {
    return this.request({
      url: 'yddgoods/YddStoresV2',
      method: 'POST',
      data: data,
      isShowLoading: isShowLoading||false
    })
  }

  // 获取推荐服务 - 推荐的附近服务中心选择，如果附近没有服务中心返回管家
  getRecommendService(data) {
    return this.request({
      url: 'yddgoods/RecommendServiceCore',
      method: 'POST',
      data: data,
      isShowLoading: false
    })
  }

  // 获取最近门店
  getRecommendStores(data) {
    return this.request({
      url: 'yddgoods/YddRecommendedStores',
      method: 'POST',
      data: data
    })
  }


  // 获取门店相关信息
  getStoreInfo(data) {
    return this.request({
      url: 'yddgoods/GetStoreInfoV2',
      method: 'POST',
      data
    })
  }

  // 获取平台优惠券专区列表
  getPlatformCouponPrefecture(data) {
    return this.request({
      url: 'goods/GetRecommendList',
      method: 'POST',
      data
    })
  }

  // 获取优惠券专区商品列表
  getCouponPrefectureGoods(data) {
    return this.request({
      url: 'goods/GetRecommendGoodsList',
      method: 'POST',
      data
    })
  }

  // 获取平台类目列表
  getPlatformClassify(data) {
    return this.request({
      url: 'goods/GetGoodsOpts',
      method: 'POST',
      data
    })
  }

  // 商品搜索
  searchGoodsByPlatform(data) {
    return this.request({
      url: 'goods/GoodsSearch',
      method: 'POST',
      data
    })
  }

  // 获取优惠券领取通知
  getCouponGainNotify() {
    return this.request({
      url: 'goods/ReceivingNews',
      method: 'POST',
      isShowLoading:false
    })
  }

  // 搜券 - 搜素第三方平台商品的优惠券
  searchPlatformGoodsCoupon(data) {
    return this.request({
      url: 'goods/SearchCoupon',
      method: 'POST',
      data
    })
  }

  // 搜券历史
  searchPlatformCouponHistory(data) {
    return this.request({
      url: 's/goods/GetChangeLinkRecord',
      method: 'POST',
      data
    })
  }

  // 删除搜券历史
  deleteSearchCouponHistory() {
    return this.request({
      url: 's/goods/DelChangeLinkRecord',
      method: 'POST'
    })
  }

  // 完成新手任务
  completeNewTask(data) {
    return this.request({
      url: 's/lottery/EndNewQuest',
      method: 'POST',
      data:data,
      isShowerrMsg:false
    })
  }

  // 秒杀时间段
  getSeckillTimePart(data, param) {
    return this.request({
      url: 'yddgoods/SeckillTimePart',
      method: 'POST',
      data,
      ...param
    })
  }

  // 获取秒杀时间段中的商品
  // getSeckillTimeGoods(data, param) {
  //   return this.request({
  //     url: 'yddgoods/SeckillGoods',
  //     method: 'POST',
  //     data,
  //     ...param
  //   })
  // }
  getSeckillTimeGoods(data, param) {
    return this.request({
      url: 'yddgoods/SeckillGoodsV2',
      method: 'POST',
      data,
      isShowLoading: false,
      ...param
    })
  }

  // 获取秒杀步骤信息
  getSeckillStepsInfo(data, param) {
    return this.request({
      url: 'yddgoods/ObtainSpikepreCondition',
      method: 'POST',
      data,
      ...param
    })
  }

  // 秒杀观看广告后调用
  seckillViewAd(data, param) {
    return this.request({
      url: 's/yddgoods/CreateSpikeAdvert',
      method: 'POST',
      data,
      ...param
    })
  }

  // 创建秒杀订单
  createSeckillOrder(data, param) {
    return this.request({
      url: 's/yddgoods/CreateSpikeOrder',
      method: 'POST',
      data,
      ...param
    })
  }

  //消息订阅
  setAlert(data) {
    return this.request({
      url: 's/wxmsg/Subscribe',
      method: 'POST',
      data
    })
  }

  // 观看广告获取幸运豆/秒杀豆
  viewAdGetBean(data) {
    return this.request({
      url: 's/lottery/ViewAD',
      method: 'POST',
      data
    })
  }

  // 秒杀多兑换
  seckillBeanExchange(data) {
    return this.request({
      url: 's/userinfo/MiaoCashPea',
      method: 'POST',
      data
    })
  }

  seckillBeanViewAdNum() {
    return this.request({
      url: 's/lottery/MiaoViewADCount',
      method: 'POST'
    })
  }

  // -------------------------------------------------

  // 获取首页信息
  getMainPage(data) {
    return this.request({
      url: 'album/MainPage2',
      method: 'POST',
      data: data
    })
  }

  // 获取巷友商品类目
  getYddGoodsCategroy() {
    return this.request({
      url: 'yddgoods/YddGoodsCategroy',
      method: 'POST'
    })
  }

  // 获取巷友商品列表
  getYddGoodsList(data) {
    return this.request({
      url: 'yddgoods/YddGoodsList',
      method: 'POST',
      data: data
    })
  }
  //获取底部订单配送信息
  getBottonDeliverOrder(data) {
    return this.request({
      url: 'order/deliverOrder',
      method: 'POST',
      isJavaRequest: true,
      data: data,
      isShowLoading: false
    })
  }

  //搜索服务点 带街道的
  getyddSearchServicePointr(data) {
    return this.request({
      url: 'yddgoods/YddSearchServicePoint',
      method: 'POST',
      data: data
    })
  }
  // 获取巷友门店
  getYddStores(data) {
    return this.request({
      url: 'yddgoods/YddSearchStores',
      method: 'POST',
      data: data
    })
  }

  // 获取巷友相似商品推荐
  getYddSimilarGoods(data) {
    return this.request({
      url: 'yddgoods/YddSimilarGoodsList',
      method: 'POST',
      data: data
    })
  }

  // 申请合作
  applyCooperation(data) {
    return this.request({
      url: 's/yddgoods/YddCooperation',
      method: 'POST',
      data: data
    })
  }

  //获取订单列表
  getOrderList(data) {
    return this.request({
      url: 'order/xhbOrderList',
      method: 'POST',
      data: data,
      isJavaRequest: true,
      isShowLoading: false
    })
  }

  // 获取秒杀订单列表
  getSeckillOrderList(data) {
    return this.request({
      url: 's/yddgoods/GetSpikeOrderList',
      method: 'POST',
      data: data,
      // isJavaRequest: true,
      isShowLoading: false
    })
  }

  //确认收货
  getFinishOrder(data) {
    return this.request({
      url: 'order/finishOrder',
      method: 'POST',
      data: data,
      isJavaRequest: true,
      isShowLoading: false
    })
  }

  //获取我要免单分享图
  FreesheetImg(data) {
    return this.request({
      url: 'luckdraw/FreesheetImgV2',
      method: 'POST',
      data: data,
      isShowLoading: false
    })
  }


  //免单页面数据
  getFreesheetInfo(data) {
    return this.request({
      url: 'luckdraw/FreesheetInfo',
      method: 'POST',
      data: data,
      isShowerrMsg:false,
      isShowLoading: false
    })
  }


  //帮他免单
  helpFreesheet(data) {
    return this.request({
      url: 's/luckdraw/HelpFreesheet',
      method: 'POST',
      data: data,
      isShowLoading: false
    })
  }

  //正在参与免单人员
  newFreesheett(data) {
    return this.request({
      url: 'luckdraw/NewFreesheet',
      method: 'POST',
      data: data,
      isShowLoading: false
    })
  }

  //获取业务订阅状态
  GetSubscribeStatus(data) {
    return this.request({
      url: 's/wxmsg/GetSubscribeStatus',
      method: 'POST',
      data: data,
      isTempToken:true,
      isShowLoading: false
    })
  }

}

export {
  HomeHttp
}
